#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
    char ch;
    while (scanf("%c", &ch) != EOF)
    {
        getchar();
        if (ch >= 'A' && ch <= 'Z')
        {
            printf("%c\n", ch + 32);
        }
        if (ch >= 'a' && ch <= 'z')
        {
            printf("%c\n", ch - 32);
        }
    }
    return 0;
    
}
int main1() {
    char ch;
    
    while (scanf("%c", &ch) != EOF) {
        if (ch >= 'a' && ch <= 'z') {
            printf("%c\n", ch-32);
        }
        else if (ch >= 'A' && ch <= 'Z') {
            printf("%c\n", ch+32);
        }
    }
    return 0;
}
